package service;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import bean.UserBean;

import dbcon.DBCon;

public class UserService {
	DBCon dbcon = new DBCon();
	ResultSet rs = null;
	
	public List<UserBean> getUser(){
		UserBean userBean = new UserBean();
		List<UserBean> userList = new ArrayList<UserBean>();
		userBean.setUsername("admin");
		userBean.setPassword("111111");
		userList.add(userBean);
		userBean.setUsername("xuqiu");
		userBean.setPassword("111111");
		userList.add(userBean);
		userBean.setUsername("zhongjianyewu");
		userBean.setPassword("111111");
		userList.add(userBean);
		userBean.setUsername("shujuyingyong");
		userBean.setPassword("111111");
		userList.add(userBean);
		return userList;
	}
	public String login(String username,String password){
//		List<UserBean> userList = new ArrayList<UserBean>();
		UserBean userBean = new UserBean();
		userBean.setUsername(username);
		userBean.setPassword(password);
		String info = null;
//		userList = getUser();
		if(username.equals("admin") && password.equals("111111") || 
				username.equals("xuqiu") && password.equals("111111") || 
				username.equals("zhongjianyewu") && password.equals("111111") || 
				username.equals("shujuyingyong") && password.equals("111111")){
			info="success";
		}else{
			info="failed";
		}
		System.out.println("info:"+info);
		return info;
	}
}
